package com.doubi.controller.sysPermission;

import com.doubi.common.aspectj.annotation.SysLog;
import com.doubi.model.sys.TSysUser;
import com.doubi.vo.AppModel;
import com.doubi.service.SysUserRoleService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by IntelliJ IDEA.
 * User: MrDoubi
 * Date: 2019/6/28
 * Time: 17:03
 */
@Controller
@RequestMapping("sysUserRole")
public class SysUserRoleController {

    @Autowired
    private SysUserRoleService sysUserRoleService;

    /**
     * 功能描述：新增或更新用户
     * @author   MrDoubi 2019-06-28 17:59
     * @param sysUser       TSysUser对象
     * @param roleOid       角色oid
     * @return              返回AppModel对象
     */

    @SysLog(title = "新增或更新用户")
    @RequiresPermissions("sysUserRole:saveSysUser")
    @PostMapping("saveSysUser")
    @ResponseBody
    public AppModel saveSysUser(TSysUser sysUser, String roleOid){
        return sysUserRoleService.saveSysUser(sysUser,roleOid);
    }


}
